home *** CD-ROM | disk | FTP | other *** search
/ QuickTime 2.0 Beta / Quicktime 2.0 Beta.iso / Programming Stuff / Interfaces / Universal Interfaces / Processes.h < prev    next >
Encoding:
C/C++ Source or Header  |  1994-01-30  |  6.3 KB  |  222 lines  |  [TEXT/MPS ]

  1. /*
  2.     File:        Processes.h
  3.  
  4.     Copyright:    © 1984-1993 by Apple Computer, Inc., all rights reserved.
  5.  
  6.     WARNING
  7.     This file was auto generated by the interfacer tool. Modifications
  8.     must be made to the master file.
  9.  
  10. */
  11.  
  12. #ifndef __PROCESSES__
  13. #define __PROCESSES__
  14.  
  15. #ifndef __TYPES__
  16. #include <Types.h>
  17. /*    #include <ConditionalMacros.h>                                */
  18. /*    #include <MixedMode.h>                                        */
  19. /*        #include <Traps.h>                                        */
  20. #endif
  21.  
  22. #ifndef __EVENTS__
  23. #include <Events.h>
  24. /*    #include <Quickdraw.h>                                        */
  25. /*        #include <QuickdrawText.h>                                */
  26. /*            #include <IntlResources.h>                            */
  27. /*    #include <OSUtils.h>                                        */
  28. #endif
  29.  
  30. #ifndef __FILES__
  31. #include <Files.h>
  32. /*    #include <SegLoad.h>                                        */
  33. #endif
  34.  
  35.  
  36. /* type for unique process identifier */
  37.  
  38. #if defined(powerc) || defined (__powerc)
  39. #pragma options align=mac68k
  40. #endif
  41. struct ProcessSerialNumber {
  42.     unsigned long                highLongOfPSN;
  43.     unsigned long                lowLongOfPSN;
  44. };
  45. #if defined(powerc) || defined(__powerc)
  46. #pragma options align=reset
  47. #endif
  48.  
  49. typedef struct ProcessSerialNumber ProcessSerialNumber;
  50.  
  51. typedef ProcessSerialNumber *ProcessSerialNumberPtr;
  52.  
  53. enum  {
  54. /*************************************************************************
  55.  *                            Process identifier.
  56.  ************************************************************************
  57.  Various reserved process serial numbers. */
  58.     kNoProcess                    = 0,
  59.     kSystemProcess                = 1,
  60.     kCurrentProcess                = 2
  61. };
  62.  
  63.  
  64. /**********************************************************************************************************************************************
  65.  *        Definition of the parameter block passed to _Launch.
  66.  *************************************************************************
  67.  
  68. * Typedef and flags for launchControlFlags field */
  69.  
  70. typedef unsigned short LaunchFlags;
  71.  
  72. enum  {
  73. /*************************************************************************
  74.  *        Definition of the parameter block passed to _Launch.
  75.  *************************************************************************/
  76.     launchContinue                = 0x4000,
  77.     launchNoFileFlags            = 0x0800,
  78.     launchUseMinimum            = 0x0400,
  79.     launchDontSwitch            = 0x0200,
  80.     launchAllow24Bit            = 0x0100,
  81.     launchInhibitDaemon            = 0x0080
  82. };
  83.  
  84.  
  85. /* Format for first AppleEvent to pass to new process.  The size of the overall
  86.  * buffer variable: the message body immediately follows the messageLength.
  87.  */
  88.  
  89. #if defined(powerc) || defined (__powerc)
  90. #pragma options align=mac68k
  91. #endif
  92. struct AppParameters {
  93.     EventRecord                    theMsgEvent;
  94.     unsigned long                eventRefCon;
  95.     unsigned long                messageLength;
  96. };
  97. #if defined(powerc) || defined(__powerc)
  98. #pragma options align=reset
  99. #endif
  100.  
  101. typedef struct AppParameters AppParameters;
  102.  
  103. typedef AppParameters *AppParametersPtr;
  104.  
  105.  
  106. /* Parameter block to _Launch */
  107.  
  108. #if defined(powerc) || defined (__powerc)
  109. #pragma options align=mac68k
  110. #endif
  111. struct LaunchParamBlockRec {
  112.     unsigned long                reserved1;
  113.     unsigned short                reserved2;
  114.     unsigned short                launchBlockID;
  115.     unsigned long                launchEPBLength;
  116.     unsigned short                launchFileFlags;
  117.     LaunchFlags                    launchControlFlags;
  118.     FSSpecPtr                    launchAppSpec;
  119.     ProcessSerialNumber            launchProcessSN;
  120.     unsigned long                launchPreferredSize;
  121.     unsigned long                launchMinimumSize;
  122.     unsigned long                launchAvailableSize;
  123.     AppParametersPtr            launchAppParameters;
  124. };
  125. #if defined(powerc) || defined(__powerc)
  126. #pragma options align=reset
  127. #endif
  128.  
  129. typedef struct LaunchParamBlockRec LaunchParamBlockRec;
  130.  
  131. typedef LaunchParamBlockRec *LaunchPBPtr;
  132.  
  133.  
  134. /* Set launchBlockID to extendedBlock to specify that extensions exist.
  135. * Set launchEPBLength to extendedBlockLen for compatibility.*/
  136.  
  137. #define extendedBlock ((unsigned short)'LC')
  138.  
  139. #define extendedBlockLen (sizeof(LaunchParamBlockRec) - 12)
  140.  
  141. enum  {
  142. /*************************************************************************
  143.  * Definition of the information block returned by GetProcessInformation
  144.  ************************************************************************
  145.  Bits in the processMode field */
  146.     modeDeskAccessory            = 0x00020000,
  147.     modeMultiLaunch                = 0x00010000,
  148.     modeNeedSuspendResume        = 0x00004000,
  149.     modeCanBackground            = 0x00001000,
  150.     modeDoesActivateOnFGSwitch    = 0x00000800,
  151.     modeOnlyBackground            = 0x00000400,
  152.     modeGetFrontClicks            = 0x00000200,
  153.     modeGetAppDiedMsg            = 0x00000100,
  154.     mode32BitCompatible            = 0x00000080,
  155.     modeHighLevelEventAware        = 0x00000040,
  156.     modeLocalAndRemoteHLEvents    = 0x00000020,
  157.     modeStationeryAware            = 0x00000010,
  158.     modeUseTextEditServices        = 0x00000008
  159. };
  160.  
  161.  
  162. /* Record returned by GetProcessInformation */
  163.  
  164. #if defined(powerc) || defined (__powerc)
  165. #pragma options align=mac68k
  166. #endif
  167. struct ProcessInfoRec {
  168.     unsigned long                processInfoLength;
  169.     StringPtr                    processName;
  170.     ProcessSerialNumber            processNumber;
  171.     unsigned long                processType;
  172.     OSType                        processSignature;
  173.     unsigned long                processMode;
  174.     Ptr                            processLocation;
  175.     unsigned long                processSize;
  176.     unsigned long                processFreeMem;
  177.     ProcessSerialNumber            processLauncher;
  178.     unsigned long                processLaunchDate;
  179.     unsigned long                processActiveTime;
  180.     FSSpecPtr                    processAppSpec;
  181. };
  182. #if defined(powerc) || defined(__powerc)
  183. #pragma options align=reset
  184. #endif
  185.  
  186. typedef struct ProcessInfoRec ProcessInfoRec;
  187.  
  188. typedef ProcessInfoRec *ProcessInfoRecPtr;
  189.  
  190. #ifdef __cplusplus
  191. extern "C" {
  192. #endif
  193.  
  194.  
  195. #if USES68KINLINES
  196. #pragma parameter __D0 LaunchApplication(__A0)
  197. #endif
  198. extern pascal OSErr LaunchApplication(const LaunchParamBlockRec *LaunchParams)
  199.  ONEWORDINLINE(0xA9F2);
  200. extern pascal OSErr LaunchDeskAccessory(const FSSpec *pFileSpec, ConstStr255Param pDAName)
  201.  THREEWORDINLINE(0x3F3C, 0x0036, 0xA88F);
  202. extern pascal OSErr GetCurrentProcess(ProcessSerialNumber *PSN)
  203.  THREEWORDINLINE(0x3F3C, 0x0037, 0xA88F);
  204. extern pascal OSErr GetFrontProcess(ProcessSerialNumber *PSN)
  205.  FIVEWORDINLINE(0x70FF, 0x2F00, 0x3F3C, 0x0039, 0xA88F);
  206. extern pascal OSErr GetNextProcess(ProcessSerialNumber *PSN)
  207.  THREEWORDINLINE(0x3F3C, 0x0038, 0xA88F);
  208. extern pascal OSErr GetProcessInformation(const ProcessSerialNumber *PSN, ProcessInfoRecPtr info)
  209.  THREEWORDINLINE(0x3F3C, 0x003A, 0xA88F);
  210. extern pascal OSErr SetFrontProcess(const ProcessSerialNumber *PSN)
  211.  THREEWORDINLINE(0x3F3C, 0x003B, 0xA88F);
  212. extern pascal OSErr WakeUpProcess(const ProcessSerialNumber *PSN)
  213.  THREEWORDINLINE(0x3F3C, 0x003C, 0xA88F);
  214. extern pascal OSErr SameProcess(const ProcessSerialNumber *PSN1, const ProcessSerialNumber *PSN2, Boolean *result)
  215.  THREEWORDINLINE(0x3F3C, 0x003D, 0xA88F);
  216. #ifdef __cplusplus
  217. }
  218. #endif
  219.  
  220. #endif
  221.  
  222.